package xianchenglock;

/**
 * @功能
 * @创建时间 2019/12/17
 */
public class SynChronize {
    private int count = 10;
    private Object o = new Object();
    public void m(){
   synchronized (o){ //任何线程要执行必须拿到o的锁
       count++;
       System.out.println(Thread.currentThread().getName()+"count="+count);
   }
    }
}
